<include file="Base:common_head" />
<script type="text/javascript">
    $(function(){
        
        $("#ks-switchable7").click(function(){
            $(".tab-content").children("div").hide();
            $(".userdefined").show();
        });
        $("#ks-switchable8").click(function(){
            $(".tab-content").children("div").hide();
            $(".comment").show();
        });
        $("#ks-switchable9").click(function(){
            $(".tab-content").children("div").hide();
            $(".records").show();
        });
       
    })
    //ajax 调取方法 新建数据 显示提示
    function go(){
        var h = window.screen.height;
        var w = window.screen.width;
        var type = '{$_SESSION["type"]}';
        if(type != ""){
            if( type == 1){
                $(".btn-buy").attr("href","javascript:;");
                $(".btn-buy").attr("target","");
                alert("设计师不能购买!");
            }else{
                var nameid = '{$temp.userid}';
                var id = '{$temp.id}';
                $.get('__URL__/buy/id/'+id+'/nameid/'+nameid,function(data){
                    $("#tips").show();
                    $("body").css({"overflow-Y":"hidden"});
                    $("#tips").css({"left":(w/2-100)+"px","top":(h/2-100)+"px","display":"block"});
                    $("#tips").html(data);
                });
       
            }
        }else{
            $(".btn-buy").attr("href","javascript:;");
            $(".btn-buy").attr("target","");
            $("#tips").show();
            $("body").css({"overflow-Y":"hidden"});
            $("#tips").css({"left":(w/2-100)+"px","top":(h/2-100)+"px","display":"block"});
            $("#tips").html("请 <a href='/index.php/Public/login' style='color:red;'>登录</a> 后进行购买");
        }
    }
    //确认
    function goy(i,ind){
        var wwname = $("#wwname").val();
        if(i ==1){
            $.get('__URL__/buyy/ind/'+ind+'/wwname/'+wwname,function(data){
                $("#tips").hide();
                $("body").css({"overflow":"auto"});
                window.location.href='__APP__/User/orderlist';
            });
        }else{
            $("#tips").hide();
            $("body").css({"overflow":"auto"});
        }
    }
    
  
    
</script>
<div class="detail-up">
    <div class="template-info">
        <div class="layout">
            <div class="col-main">
                <div class="main-wrap template-detail">
                    <i <if condition="$temp.farmwork eq 1 or $temp.farmwork eq 6 "> class="advanced-mark"<elseif condition="$temp.farmwork eq 2 or $temp.farmwork eq 7 " />class="jy"<elseif condition="$temp.farmwork eq 3" />class="jsm"</if>></i>
                    <div class="sale-info">
                        <h2>{$temp.title}</h2>
                        <div class="fon">
                            <dl class="contents">
                                <dt>淘宝售量：</dt>
                                <dd><strong>{$html}</strong></dd>
                            </dl>
                            <dl class="contents red">
                                <dt>本站售量：</dt>
                                <dd><strong>{$temp.count}</strong></dd>
                            </dl>
                            <dl class="contents li">
                                <dt>模板价格：</dt>
                                <dd><span>¥ </span><strong><span class="price-s-show">{$temp.price}元</span></dd>
                                <input type="hidden" class="price-s" value="30.00">
                            </dl>
                            <dl class="contents red">
                                <dt>本站价格：</dt>
                                <dd><span>¥ </span><strong><span class="price-s-show"><?php echo  $temp['price']-$temp['price']*$temp['rate']; ?>元</span></strong> </dd>
                                <input type="hidden" class="price-s" value="30.00">
                            </dl>
                        </div>
                    </div>
                    <div class="btn-list">
                        <a href="http://zx<if condition='$temp.type eq 1'>n</if>.taobao.com/detail.htm?id={$temp.id}" target="_blank" onclick="go()" class="btn-buy" title="立即购买"></a>
                        <a href="<if condition='$temp.type eq 1'>http://zxn.taobao.com/tryTemplate.htm?productId={$temp.id}<else/>http://zx.taobao.com/try_template.htm?templateId={$temp.id}</if>" target="_blank" class="btn-prev" title="立即试用"></a>
                    </div>
                    <div class="separation-line">
                    </div>
                    <div class="sns-section">
                        <div class="designer">
                            <a class="nick" href="#">设计师:  {$temp.ww} </a>
                            <a href="http://amos.im.alisoft.com/msg.aw?spm=0.0.0.0.UZIR91&amp;v=2&amp;uid={$temp.ww}&amp;s=1&amp;site=cntaobao&amp;charset=utf-8" target="_blank">
                                <img border="0" alt="" src="http://amos.im.alisoft.com/online.aw?v=2&amp;uid={$temp.ww}&amp;site=cntaobao&amp;s=1&amp;charset=utf-8">
                            </a>
                        </div>
                    </div>
                </div>
            </div>
            <div class="template-image col-sub">
                <a href="http://zx<if condition='$temp.type eq 1'>n</if>.taobao.com/detail.htm?id={$temp.id}"><img src="{$temp.frontpage}" ></a>
            </div>
        </div>
    </div>
</div>
<div class="detail-down">
    <div class="layout">
        <div class="mkmenu" id="J_menu">
            <ul class="tabbar clear" role="tablist">
                <li class="selected" role="tab" tabindex="0" id="ks-switchable7">模板详情</li>
            </ul>
            <span id="ht"></span>

        </div>
    </div>
</div>

</body>
</html>
